package com.appwoo.txtws.component;

import android.content.Context;
import android.content.res.Resources;
import android.os.Build.VERSION;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.widget.Button;

public class PhoneHangUp
{
  public static boolean blExistsView = false;
  private static Button btnHangUp = null;
  static Context mContext;
  static View phoneHangupView = null;
  static WindowManager winManager = null;

  public static void Hide(Context paramContext)
  {
    if (winManager != null)
      blExistsView = false;
    try
    {
      winManager.removeView(phoneHangupView);
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  public static void Show(Context paramContext)
  {
    mContext = paramContext;
    if (phoneHangupView == null)
    {
      phoneHangupView = ((LayoutInflater)paramContext.getSystemService("layout_inflater")).inflate(2130903168, null);
      btnHangUp = (Button)phoneHangupView.findViewById(2131493347);
      btnHangUp.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          Global.getTelephony(PhoneHangUp.mContext, "end");
          Global.isDialAgo = false;
          Global.isDialStatus = false;
          PhoneHangUp.Hide(PhoneHangUp.mContext);
        }
      });
    }
    if (winManager == null)
      winManager = (WindowManager)paramContext.getSystemService("window");
    int i = 2003;
    if (Build.VERSION.SDK_INT >= 14)
      i = 2006;
    int j = Resources.getSystem().getIdentifier("status_bar_height", "dimen", "android");
    if ((j != 0) && (Resources.getSystem().getDimensionPixelSize(j) >= 0))
      Resources.getSystem().getDimensionPixelSize(j);
    WindowManager.LayoutParams localLayoutParams = new WindowManager.LayoutParams(150, 150, i, 296, -3);
    localLayoutParams.gravity = 80;
    localLayoutParams.type = 2010;
    if (!blExistsView)
    {
      phoneHangupView.setVisibility(0);
      winManager.addView(phoneHangupView, localLayoutParams);
      blExistsView = true;
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.component.PhoneHangUp
 * JD-Core Version:    0.6.2
 */